package megrez.mail.sender.web.vo;

import java.util.Locale;

import org.springframework.beans.BeanUtils;

import lombok.Data;
import megrez.mail.sender.domain.TemplateContent;

/**
 * 模板内容VO
 * 
 * @author Lucky Yang
 * @since 2.6.9
 */
@Data
public class TemplateContentVO{
    private String id;
    private Integer version;
    private String subject;
    private Locale locale;
    private String data;
    
    public TemplateContentVO() {
    }

    public TemplateContentVO(String subject, Locale locale, String data) {
        this.subject = subject;
        this.locale = locale;
        this.data = data;
    }

    public static TemplateContentVO of(TemplateContent content) {
        if (content == null) {
            return null;
        }
        TemplateContentVO rslt = new TemplateContentVO();
        BeanUtils.copyProperties(content, rslt);
        return rslt;
    }

    @Override
    public boolean equals(Object o) {
        return super.equals(o);
    }

    @Override
    public int hashCode() {
        return super.hashCode();
    } 
}
